As is known, the programming cycle of a nonvolatile memory, for example an EEPROM, to which reference will be made hereinafter without limiting thereto, comprises a plurality of steps including supplying data to be written and corresponding addresses, addressing the portion (line) of the memory to be programmed, erasing data previously stored in this memory portion, and writing new data. If programming is interrupted during the last two steps (erasing and writing), for example for a sudden drop in the supply voltage, depending on the exact moment when this occurs, there may be loss of the new data being programmed, or possibly even old data previously contained in the addressed memory portion. This loss can cause problems when the memory attempts to resume writing or subsequently when reading the incorrect content of the memory portion in which the problem occurred.